<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        *{
            margin:0;
            padding:0;
        }
        #box{
            width:360px;
            height:400px;
            border:1px solid red;
            margin:0 auto;
        }
        #box .top{
            height:60px;
            background: yellow;
        }
        #box .top .bgred{
            background: red;
        }
        #box .top .bgblue{
            background: blue;
        }
        #box .top .bggreen{
            background: green;
        }
        #box .top div{
            width:120px;
            height:60px;
            background: black;
            color:white;
            font:bold 32px/60px "微软雅黑";
            text-align: center;
            float:left;
        }
        #box .top div.active{
            background: white;
            color:black;
        }
        #box .content{
            height:340px;
            position:relative;
        }
        #box .content div{
            position:absolute;
            top:0;
            left:0;
            height:340px;
            width:360px;
            background: chartreuse;
            text-align: center;
            line-height: 340px;
            font-size:148px;
            color:white;
            display: none;
        }
        #box .content .red{
            background: red;
        }
        #box .content .blue{
            background: blue;
        }
        #box .content .green{
            background: green;
        }
        #box .content .active{
            display: block;
        }
    </style>
</head>
<body>
<div id="box">
    <div class="top">
        <div class="active" class="bgred" bg="red">红色</div>
        <div class="bgblue" bg="blue">蓝色</div>
        <div class="bggreen" bg="green">绿色</div>
    </div>

    <div class="content">
        <div class="red active">红色</div>
        <div class="blue">蓝色</div>
        <div class="green">绿色	</div>
    </div>

    <div class="test">
        abcdefg
    </div>
    <span class="test">123123</span>
    <span>2222</span>
    <span class="test">333</span>
</div>
<script src="../jquery-1.7.2.min.js"></script>
<script>
    $(function(){
//        兄弟之间查找.siblings()
        $('#box .top').siblings('span').css('color','red');
//        找父级

    })
</script>































</body>
</html>
